## [What is mode_t in C?](https://jameshfisher.com/2017/02/24/what-is-mode_t/)

    #define S_IRWXU 0000700    /* RWX mask for owner */
    #define S_IRUSR 0000400    /* R for owner */
    #define S_IWUSR 0000200    /* W for owner */
    #define S_IXUSR 0000100    /* X for owner */

    #define S_IRWXG 0000070    /* RWX mask for group */
    #define S_IRGRP 0000040    /* R for group */
    #define S_IWGRP 0000020    /* W for group */
    #define S_IXGRP 0000010    /* X for group */

    #define S_IRWXO 0000007    /* RWX mask for other */
    #define S_IROTH 0000004    /* R for other */
    #define S_IWOTH 0000002    /* W for other */
    #define S_IXOTH 0000001    /* X for other */

    #define S_ISUID 0004000    /* set user id on execution */
    #define S_ISGID 0002000    /* set group id on execution */
    #define S_ISVTX 0001000    /* save swapped text even after use */

    rwxr-xr-x = 0755 standart dir  premission
    rw-r--r-- = 0644 standart file premission

                Читать?	            Написать?	        Выполнить?
    Владелец	S_IRUSR = 1 << 8	S_IWUSR = 1 << 7	S_IXUSR = 1 << 6
    Группа	    S_IRGRP = 1 << 5	S_IWGRP = 1 << 4	S_IXGRP = 1 << 3
    Другое	    S_IROTH = 1 << 2	S_IWOTH = 1 << 1	S_IXOTH = 1 << 0

    0000 is ---------
    0666 is rw-rw-rw-
    0777 is rwxrwxrwx
    0700 is rwx------
    0100 is --x------
    0001 is --------x
    0002 is -------w-
    0003 is -------wx
    0004 is ------r--
    0005 is ------r-x
    0006 is ------rw-
    0007 is ------rwx